/*
 * coupon list
**/
<template>
<div class="app" v-if="lazy">
<v-tab></v-tab>
<div class="weui-cells mod-items" id="scrollbox" v-load-more="loadMore" type="2">
  <div class="scroll">
  		<!--检索-->
  		<div class="weui-search-bar" :class="{'weui-search-bar_focusing': focusing}" @click="focusin(true)">
  			<a class="weui-search-back" v-show="keyword" @click.stop="searchBack"></a>
	        <div class="weui-search-bar__form">
	            <div class="weui-search-bar__box">
	                <i class="weui-icon-search"></i>
	                <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" v-model="keyword" @keyup.enter="search($event)">
	                <a href="javascript:" class="weui-icon-clear" id="searchClear" @click.stop="focusin(false)"></a>
	            </div>
	            <label class="weui-search-bar__label" id="searchText">
	                <i class="weui-icon-search"></i>
	                <span>搜索</span>
	            </label>
	        </div>
	        <a class="weui-search-bar__cancel-btn"  @click.stop="search($event)">搜索</a>
	    </div>
	  <!--筛选-->
	  <div class="filter-box">
	  	<div class="f-item clear item-a">
		  	<ul class="tab-box tab1">
		  		<li v-for="item in couponTypeList" @click="tab(item.cid)" :class="{'active': pid === item.cid}">
		  			<i class="icon" :style="{backgroundImage: 'url('+item.thumb+')'}"></i>
		  			<span class="f-name">{{item.title}}</span>
		  		</li>
		  	</ul>
	  	</div>
	  	<div class="f-item clear item-b">
	  		<ul class="tab-box">
	  			<li v-show="pid === '33'" :class="{'active': '99' === cid}" @click="tab('99', 1)">
		  			<i class="icon by99"></i>
		  			<span class="f-name">9.9包邮</span>
		  		</li>
		  		<li v-for="item in couponTypeListLv2" :class="{'active': cid === item.cid}" @click="tab(item.cid, 1)">
		  			<i class="icon" :style="{backgroundImage: 'url('+item.thumb+')'}"></i>
		  			<span class="f-name">{{item.title}}</span>
		  		</li>
	  		</ul>
	  	</div>
	  </div>
	  <!--商品列表-->
	  <div class="goods" v-show="!dataEmpty">
	  	  <!--9.9包邮-->
		  <div class="good-list clearfix" v-show="cid === '99'">
		    <div class="good-item" v-for="item in saleList">
		      <div class="good-photo"  @click="selectIt(item.goods_id)">
		        <img :src="item.icon"/>
		      </div>
		      <div class="good-info">
		        <p class="title ellipsis">{{item.goods_name}}</p>
		        <div class="prize-box">
					<span class="pbox-n">￥<span class="prize">{{item.goods_cprice}}</span></span>
					<span class="pbox-o">￥<span class="prize">{{item.goods_oprice}}</span></span>
					<a class="btn" @click="selectIt(item.goods_id)">立即下单</a>
				</div>
				<!--<div class="btn-box">
					<span class="knum">库存{{item.goods_stock == -1?'9999':item.goods_stock}}</span>
				</div>-->
				<i class="i-empty" v-if="item.goods_stock === 0"></i>
		      </div>
		    </div>
		  </div>
		  <!--领优惠-->
		  <div class="good-list game-box clearfix" v-show="cid !== '99'">
		    <div class="weui-cell" v-for="item in couponList">
		      <div class="weui-cell__hd def-icon">
		        <img :src="item.icon" alt="" class="logo"/>
		      </div>
		      <div class="weui-cell__bd">
		        <p class="cell__bd-tit ellipsis">{{item.title}}</p>
		        <p class="cell__bd-dsc" v-if="item.type === 6">有效期至：{{item.deadline}}</p>
		        <p class="cell__bd-dsc" v-if="item.type !== 7">{{item.desc}}</p>
		        <p class="cell__bd-dsc" v-if="item.type === 7"><span class="price1">原　价￥{{item.original_price}}</span></p>
		        <p class="cell__bd-dsc" v-if="item.type === 7">券后价￥<span class="price2">{{item.sale_price}}</span></p>
		      </div>
		      <div class="weui-cell__ft reset-ft">
		        <a class="btn" @click="turnCoupon(item.tid, item.link)" v-if="item.type === 1">查看详情</a>
		        <a class="btn" @click="photoshow(item.tid, item.coupon_img)" v-if="item.type === 6">查看详情</a>
		        <a class="btn copy" @click="tokenshow(item.tid, item.secret_key)" v-if="item.type === 7">查看详情</a>
		      </div>
		    </div>
		  </div>
		  <div class="weui-loadmore" v-show="!touchend">
		    <i class="weui-loading"></i>
		    <span class="weui-loadmore__tips">正在加载</span>
		  </div>
		  <div class="weui-loadmore weui-loadmore_line" v-if="touchend">
		      <span class="weui-loadmore__tips">期待上新</span>
		  </div>
		  <div class="mod-footer-place"></div>
	  </div>
	  <div class="goods tc" v-show="dataEmpty" style="padding-bottom: 1rem;">
	  	<div class="nofond"></div>
	  	<a class="seeo" @click="searchBack">看看别的吧！</a>
	  </div>
  </div>
</div>
<!--购买商品选择弹窗-->
<div class="g-conform" v-show="orderWin">
	<div class="g-panal" v-if="goodInfo.goods">
        <div class="weui-cell" style="padding:18px 15px;">
            <div class="weui-media-box__hd g-avator">
                <img class="weui-media-box__thumb" :src="attrInfo.sku_img"/>
            </div>
            <div class="weui-media-box__bd g-info">
                <h4 class="weui-media-box__title">{{goodInfo.goods.goods_name}}</h4>
                <div class="prize-box">
					<span class="pbox-n">￥<span class="prize">{{attrInfo.sku_cprice}}</span></span>
	        		<span class="pbox-o">￥<span class="prize">{{attrInfo.sku_oprice}}</span></span>
				</div>
                <p class="weui-media-box__desc">{{skuAttrName}}</p>
            </div>
            <a class="g-close" @click="closeCar"></a>
        </div>
        <div class="weui-media-box" v-for="(el, index) in goodInfo.properties">
            <h4 class="weui-media-box__title g-title">{{el.title}}</h4>
            <p class="weui-media-box__desc g-tags-box">
            	<span class="g-tag ellipsis" v-for="(attr, _index) in el.attr" @click="attrTab($event, index, _index, attr.attr_id)" :class="{'active': aAttr[index] == attr.attr_id, 'disable': discss(index, attr.attr_id)}">{{attr.attr_name}}</span>
            </p>
        </div>
        <div class="weui-cell">
            <h4 class="weui-media-box__title g-title">数量</h4>
            <div class="g-num-box"><span @click="adj(-1)">-</span><input type="text" readonly="readonly" v-model="num"/><span @click="adj(1)">+</span></div>
        </div>
        <div class="weui-cell" @click="usedescore">
            <div class="weui-cell__hd"><div class="radio" :class="{'select': useDeScore}" v-if="scoreInfo"></div></div>
            <div class="weui-cell__bd" v-if="scoreInfo"><p class="g-dikou">可用{{deScore}}积分抵用{{deScore/100}}元</p></div>
            <div class="weui-cell__bd" v-if="!scoreInfo"><p style="font-size:0.11rem;">没有可抵扣的积分</p></div>
        </div>
	</div>
	<div class="g-footer weui-cell">
		<p class="g-prize-box"><span>合计金额：</span><span class="prize">{{calTotalPrice()}}元</span></p>
		<a class="g-sub" @click="subOrder">提交订单</a>
	</div>
</div>
<modal-dialog ref="dialog"></modal-dialog>
<div v-if="inGetData">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast" style="margin-top:3.8em; background:rgba(17, 17, 17, 0.5)">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">数据加载中</p>
    </div>
</div>
<winpay v-show="payPage" ref="winpay" @back="closePayPage"></winpay>
</div>
</template>
<script>
import {getCouponTypeList, getCouponList, getSaleList, setCouponRecord, addCart, getCart, getUserCredit, clickRecord, duringRecord} from 'src/service/getData'
import modalDialog from 'src/components/dialog'
import {loadMore} from 'src/config/mixin'
import vTab from 'components/common/tab'
import Clipboard from 'clipboard'
import {mapState} from 'vuex'
import winpay from '../pay/index'
export default {
  data () {
    return {
      inGetData: false,
      currentPage: 1, // 当前页码
      couponTypeList: [], // 一级分类
      couponTypeListLv2: [], // 二级分类
      pid: '33',
      cid: '99',
      saleList: [], // 9.9列表
      couponList: [], // 券列表
      pageSize: 20, // 每页显示数据条数
      touchend: false, // 没有更多数据
      preventRepeatReuqest: false, // 到达底部加载数据，防止重复加载
      orderWin: false, // 订单弹窗
      goodInfo: {}, // 商品详情
      aAttr: [], // 对应属性id集合
      aIndex: [], // 对应属性index集合
      groupIndex: 0, // 当前点击的属性组下标
      num: 1, // 数量
      totalPrice: 0, // 总价
      attrInfo: {}, // 最终属性
      payPage: false, // 支付窗
      scoreInfo: 0, // 用户积分
      deScore: 0, // 积分可抵扣的积分
      useDeScore: 1, // 是否使用积分抵扣
      skuAttrName: '',  // 属性文字拼接
      timeframe: {
        type: '',
        time: ''
      },
      lazy: false, // 延时渲染
      focusing: false, // 搜索框状态
      keyword: '', // 检索关键词
      dataEmpty: false // 没有检索到数据
    }
  },
  components: {
    'v-tab': vTab,
    modalDialog,
    winpay
  },
  computed: {
    ...mapState([
      'I9RIA', 'location'
    ])
  },
  mixins: [loadMore],
  mounted () {
    if (this.location) {
      this.initData()
    }
    setTimeout(() => {
      this.lazy = true
    }, 100)
  },
  beforeDestroy () {
    this.visiLongTime()
  },
  methods: {
    initData () {
      this.inGetData = true
      this.getCouponTypeList(0)
      this.getCouponTypeList(this.pid, true)
      this.getUserScore()
    },
    async getUserScore () { // 获取用户积分
      let tmpData = await getUserCredit()
      if (tmpData.code !== 0) return
      this.scoreInfo = tmpData.data.credit_point
    },
    async getCouponTypeList (id, isChild) { // 菜单数据
      let tmpData = await getCouponTypeList(id)
      if (tmpData.code !== 0) return
      if (isChild) {
        this.couponTypeListLv2 = tmpData.data.list
        if (this.pid === '33') {
          this.tab('99', true)
        } else {
          this.tab(this.couponTypeListLv2[0].cid, true)
        }
        return false
      }
      this.couponTypeList = tmpData.data.list
    },
    tab (cid, isChild) { // 切换类
      if (isChild) {
        this.inGetData = true
        this.touchend = false
        this.currentPage = 1
        this.cid = cid
        if (cid === '99') {
          this.getSaleList()
        } else {
          this.getCouponList()
        }
      } else {
        this.pid = cid
        this.getCouponTypeList(cid, true)
      }
      this.visiLongTime()
      if (this.pid === '33') {
        if (this.cid === '35') {
          this.timeframe = {'type': 'taobao', 'time': +new Date()}
        } else if (this.cid === '99') {
          this.timeframe = {'type': 'by99', 'time': +new Date()}
        }
      }
    },
    async getSaleList () { // 9.9
      this.preventRepeatReuqest = true
      let tmpData = await getSaleList(this.currentPage, this.keyword, this.pageSize)
      this.loadEnd('saleList', tmpData)
    },
    async getCouponList () { // 优惠
      this.preventRepeatReuqest = true
      let tmpData = await getCouponList(this.currentPage, this.keyword, this.cid, this.pageSize, 0)
      this.loadEnd('couponList', tmpData)
    },
    loadMore () {
      // 最后一页不再加载 || 防止重复请求
      if (this.touchend || this.preventRepeatReuqest) {
        return
      }
      this.currentPage++
      this.cid === '99' ? this.getSaleList() : this.getCouponList()
    },
    loadEnd (listName, _tmpData) {
      this.inGetData = false
      this.dataEmpty = false
      if (_tmpData.code !== 0) return
      let dataList = _tmpData.data.list
      if (this.currentPage === 1) {
        this[listName] = dataList
        if (dataList.length === 0) this.dataEmpty = true
      } else {
        this[listName] = [...this[listName], ...dataList]
      }
      // 最后一页
      if (dataList.length < this.pageSize) {
        this.touchend = true
      }
      setTimeout(() => {
        this.preventRepeatReuqest = false
      }, 300)
    },
    turnCoupon (_tid, _link) { // 跳转第三方
      setCouponRecord(_tid)
      window.location.href = _link
    },
    photoshow (_tid, _src) { // 图券
      setCouponRecord(_tid)
      this.$refs.dialog.confirm('<img style="position: absolute;bottom: 0;left: 0;width: 100%;" src="' + _src + '"/>', {
        type: 'alert'
      })
    },
    tokenshow (_tid, _token) { // 淘口令
      let _this = this
      setCouponRecord(_tid)
      let clipboard = new Clipboard('.copy', {
        text () {
          return _token
        }
      })
      clipboard.on('success', function (e) {
        _this.$refs.dialog.confirm('<h3>淘口令：' + _token + ' 已复制，打开【手机淘宝】即可领券并下单！</h3>', {
          type: 'tips',
          okText: '好的'
        })
        clipboard.destroy()
      })
      clipboard.on('error', function (e) {
        _this.$refs.dialog.confirm('<h3 style="-webkit-user-select:auto;color:#ffa200;">' + _token + '</h3><h3>长按复制上方淘口令后，打开【手机淘宝】即可领券并下单！</h3>', {
          type: 'tips',
          okText: '好的'
        })
        clipboard.destroy()
      })
    },
    async selectIt (id) { // 添加商品购物车，从购物车取商品信息
      document.getElementById('scrollbox').style.overflowY = 'hidden'
      clickRecord('sale', 'addCart')
      this.inGetData = true
      await addCart(id)
      let res = await getCart()
      if (res.code !== 0) return
      this.goodInfo = res.data
      this.orderWin = true
      this.skuAttrName = ''
      this.attrInfo.sku_attr_name = ''
      this.attrInfo.sku_cprice = res.data.goods.goods_cprice
      this.attrInfo.sku_oprice = res.data.goods.goods_oprice
      this.attrInfo.sku_img = res.data.goods.icon
      this.attrInfo.sku_id = ''
      this.totalPrice = res.data.goods.goods_cprice
      this.deScore = this.totalPrice * 100 < this.scoreInfo ? Math.round(this.totalPrice * 100) : this.scoreInfo
      // 默认选第一个
      this.num = 1
      this.aAttr = new Array(res.data.properties.length)
      this.aIndex = new Array(res.data.properties.length)
      // this.attrTab(null, 0, 0, res.data.properties[0].attr[0].attr_id)
      this.inGetData = false
    },
    closeCar () {
      document.getElementById('scrollbox').style.overflowY = 'auto'
      this.orderWin = false
      this.groupIndex = 0
    },
    attrTab (e, index, _index, id) {
      if (e && e.target.className.indexOf('disable') !== -1) return // 灰色无法点击
      if (e && e.target.className.indexOf('active') !== -1) { // 取消选择
        id = null
      }
      this.$set(this.aAttr, index, id)
      this.$set(this.aIndex, index, _index)
      this.groupIndex = index
      this.makeTotal()
    },
    discss (index, id) { // 计算没有的组合 置灰
      let arr = []
      for (let i = 0; i < this.aAttr.length; i++) {
        arr.push(i === index ? id : this.aAttr[i])
      }
      let stock = this.goodInfo.stock
      for (let j = 0; j < stock.length; j++) {
        let brr = stock[j].sku_attr.split('|')
        let bln = true
        brr.forEach((val, key) => {
          if (/^\d*$/g.test(arr[key]) && arr[key] !== parseInt(brr[key])) { // 一位数不一样算不相等
            bln = false
          }
        })
        if (bln) return false
      }
      return true
    },
    adj (no) {
      this.num = this.num + no > 0 ? this.num + no : 1
      if (this.goodInfo.properties.length > 0) {
        this.makeTotal()
      } else {
        this.totalPrice = Math.round(this.attrInfo.sku_cprice * this.num * 100) / 100
      }
    },
    usedescore () {
      if (this.useDeScore) {
        this.useDeScore = 0
      } else {
        this.useDeScore = 1
      }
    },
    makeTotal () {
      // for (let i = 0; i < this.aAttr.length; i++) {
      // if (!/^\d*$/g.test(this.aAttr[i])) return
      // }
      // let sArr = this.aAttr.join('|')
      // if (this.aAttr.length === 1) {
      // sArr += '|'
      // }
      this.skuAttrName = ''
      let stock = this.goodInfo.stock
      let props = this.goodInfo.properties
      for (let j = 0; j < stock.length; j++) {
        let bAttr = stock[j].sku_attr.split('|')
        let equal = true
        for (let i = 0; i < bAttr.length; i++) {
          if (/^\d*$/g.test(this.aAttr[i]) && this.aAttr[i] !== parseInt(bAttr[i])) {
            equal = false
          }
          if (j === 0 && /^\d*$/g.test(this.aAttr[i])) { // 从aAttr中翻译属性
            this.skuAttrName += '|' + props[i].title + ':' + props[i].attr[this.aIndex[i]].attr_name
          }
        }
        if (equal) {
          this.attrInfo = stock[j]
          this.totalPrice = Math.round(stock[j].sku_cprice * this.num * 100) / 100
          break
        }
      }
      this.skuAttrName = this.skuAttrName.substring(1)
      if (!this.skuAttrName) this.skuAttrName = '请选择商品属性'
      this.deScore = this.totalPrice * 100 < this.scoreInfo ? Math.round(this.totalPrice * 100) : this.scoreInfo
    },
    calTotalPrice () {
      return (Math.round(this.totalPrice * 100) - (this.useDeScore ? this.deScore : 0)) / 100
    },
    subOrder () {
      for (let i = 0; i < this.aAttr.length; i++) {
        if (!/^\d*$/g.test(this.aAttr[i])) {
          this.$refs.dialog.confirm('<h3>请选择 ' + this.goodInfo.properties[i].title + '</h3>', {
            type: 'tips',
            okText: '好的'
          })
          return
        }
      }
      this.payPage = true
      this.$refs.winpay.initData({'goods_id': this.goodInfo.goods.goods_id, 'sku_id': this.attrInfo.sku_id, 'quantity': this.num, 'credits_exchange': this.useDeScore, 'price': this.calTotalPrice()})
      clickRecord('sale', 'subOrder')
    },
    closePayPage () {
      this.payPage = false
    },
    visiLongTime () {
      if (!this.timeframe.time) return
      let timex = +new Date() - this.timeframe.time
      this.timeframe.time = ''
      // console.log('coupon', this.timeframe.type, timex)
      duringRecord('coupon', this.timeframe.type, timex)
    },
    focusin (bln) {
      this.focusing = bln
      if (!bln) {
        this.keyword = ''
        return
      }
      document.getElementById('searchInput').focus()
    },
    search (e) {
      this.focusing = this.keyword !== ''
      this.currentPage = 1
      this.touchend = false
      this.cid === '99' ? this.getSaleList() : this.getCouponList()
      e && e.target.blur()
    },
    searchBack () {
      this.keyword = ''
      this.search()
    }
  },
  watch: {
    location (val) {
      if (val) {
        this.initData()
      }
    }
  }
}
</script>
<style scoped>
	.filter-box{background: #fff;}
	.f-item{overflow-x:auto;}
	.f-item.item-a{border-bottom:1px solid #eee;}
	.tab-box{width: 9999px;}
	.f-item li{float: left;text-align: center;padding: 0.08rem 0; margin: 0 0.15rem; border-bottom: 2px solid transparent;}
	.f-item li.active{border-color:#ffa200;}
	.f-item .icon{width: 0.22rem; height: 0.22rem; display: inline-block;background-repeat:no-repeat; background-size:100% auto;vertical-align: middle;}
	.f-item .icon.by99{background-image: url(../../assets/imgs/coupon/9.9.png);}
	.f-item .f-name{vertical-align: middle; font-size: 0.13rem; color: #333; padding-left: 0.08rem;}
	.f-item.item-b{padding-top: 0.15rem;}
	.f-item.item-b li{padding: 0 0 0.1rem; border: 0;position: relative;}
	.f-item.item-b .icon{width: 0.29rem; height: 0.29rem;}
	.f-item.item-b .f-name{display: block; padding: 0.05rem 0 0.02rem; text-align: center;font-size: 0.11rem;}
	.f-item.item-b li.active .icon{transform: scale(1.2);}
	.f-item.item-b li.active .f-name{font-size: 0.13rem;}
	.f-item.item-b li.active:after{content: ''; border: 5px solid transparent; border-bottom: 6px solid #efeff4; position: absolute; bottom: 0;left: 40%;}
	.goods{width: 100%; overflow: hidden;}
	.goods .nofond{background:url(../../assets/imgs/nofond.png) no-repeat;background-size:100%;height: 2rem;margin-top: 1rem;}
	.goods .seeo{color: #fff; background: #ff602a; font-size: 0.14rem; border-radius: 22px; position: relative; top: 0.2rem; padding: 0.04rem 0.1rem;}
	.good-list{width:3.75rem;}
	.good-list .good-item{width:1.72rem;margin:0.1rem .05rem 0 0.1rem;float: left; position: relative; background: #fff;border-radius: 8px;}
	.good-list .good-item:nth-child(2n){margin:0.1rem .1rem 0 0.05rem;}
	.good-photo{height: 1.72rem; overflow: hidden;border-radius: 8px 8px 0 0;}
	.good-photo img{width: 100%;}
	.good-info{padding:0.08rem;}
	.title{line-height: 0.15rem; color: #333; font-size: 0.13rem;}
	.prize-box{padding: 0.04rem 0;position:relative;}
	.pbox-n{color: #ff6f6d; font-size: 0.12rem;}
	.pbox-n .prize{font-size: 0.18rem;}
	.pbox-o{color: #cfcfcf; font-size: 0.09rem; text-decoration: line-through;display: block;line-height: 0.1rem;padding-left:0.02rem;}
	.pbox-o .prize{font-size: 0.14rem;}
	.good-info .btn-box{text-align: right;padding-right: 0.06rem;}
	.good-info .btn{background: #ffa200; color: #fff; font-size: 0.12rem; padding: 0.015rem 0.1rem; border-radius: 22px;position: absolute;right: 0.05rem; top: 0.08rem;}
	.good-info .knum{font-size: 0.11rem; color: #666; float: left; padding-top: 0.08rem;}
	.good-info .i-empty{width:0.8rem;height: 0.8rem;position: absolute;background: url(../../assets/imgs/coupon/empty.png);background-size: 100%;bottom: 0.94rem; right: -0.08rem;}
	.g-conform{position:fixed; top: 0; left: 0; bottom: 0; right: 0;background:rgba(0, 0, 0, 0.4);z-index: 999;}
	.g-panal{background: #fff; position: absolute; width: 100%;bottom: 0.44rem;overflow-y: auto;max-height:80%;-webkit-overflow-scrolling : touch}
	.g-avator{width: 1rem; height: 1rem;}
	.g-avator img{width:100%;}
	.g-info{flex: 1; padding-left: 0.1rem;}
	.g-info .weui-media-box__title{font-size: 0.13rem; width: 2.1rem; white-space: normal; color: #333;}
	.g-info .prize-box{padding: 0.12rem 0;}
	.g-info .weui-media-box__desc{color: #666;}
	.g-info .weui-media-box__desc:after{content:'　';}
	.g-title{font-size: 0.12rem; color: #333;flex: 1;}
	.g-tags-box{line-height:0.25rem;display: block;}
	.g-tag{max-width:1rem;font-size: 0.12rem;color: #333; padding: 0rem 0.18rem; background: #f5f5f5; border-radius: 22px; margin-right: 0.1rem; margin-top: 0.1rem; display: inline-block;}
	.g-tag.active{background:#ffa200;color:#fff;}
	.g-tag.disable{background:#eee;color: #ccc;}
	.g-num-box{font-size: 0.1rem; border-radius: 4px; overflow: hidden;}
	.g-num-box span{display: inline-block; width: 0.3rem; text-align: center; line-height: 0.27rem; background: #f5f5f5; color: #9a9a9a;}
	.g-num-box input{width: 0.35rem; line-height: 0.27rem; border: none; border-left: 2px solid #fff; border-right: 2px solid #fff; background: #f5f5f5; text-align: center;}
    .g-dikou{color: #ffa200; font-size: 0.11rem;text-indent: 1em;}
    .g-footer{background: #fff; position: absolute; bottom: 0; width: 100%; line-height: 0.44rem; padding: 0; box-shadow: 0 0px 4px 0 #ccc; text-align: center; font-size: 0.14rem; color: #333;}
    .g-prize-box{flex: 2;}
    .g-prize-box .prize{color: #ff6f6d;}
    .g-sub{flex: 1; background: #ffa200; color: #fff;}
    .g-close{width: 0.2rem;height: 0.2rem;background: url(../../assets/imgs/coupon/close.png);background-size: 100%;position: absolute;top: 10px; right: 10px;}
	.price1{color:#cfcfcf;}
	.price2{font-size:0.15rem;}
	
	.game-box{margin-top: 0.1rem;}
	.game-box .weui-cell{background:#fff;padding:0.1rem;-webkit-align-items:inherit;align-items:inherit;}
	.game-box .def-icon{width: 0.75rem; height: 0.75rem; overflow: hidden;margin-right: 0.08rem;border-radius:8px;border:1px solid #efefef;}
	.game-box .logo{width: 100%;}
	.game-box .cell__bd-tit{font-size: 0.16rem; color: #333; line-height: 0.28rem; font-weight: 300;width: 2.6rem !important;}
	.game-box .cell__bd-dsc{color: #f2a63b; font-size: 0.11rem;margin-top: 0.08rem;}
	.mod-items .weui-cell .weui-cell__hd img { border-radius: .05rem; }
	.game-box .weui-cell .weui-cell__ft{width: 0rem;}
	.game-box .btn{width: 0.86rem; line-height: 0.3rem; background: #ffa200; color: #fff; font-size: 0.11rem;border-radius: 22px; text-align: center;position: absolute;bottom:0.14rem;right: 0.09rem;}
	.weui-cells.mod-items{margin: 0rem !important; background: #efeff4; position:absolute;height:100%;top: 0; overflow-y: auto; left: 0; right: 0; bottom: 0;-webkit-overflow-scrolling : touch}
	.weui-cells.mod-items:after{display: none;}
	.weui-loadmore__tips{background: #efeff4;}
	.weui-search-bar__label,.weui-search-bar__form:after{border-radius: 22px;}
	.weui-search-bar__cancel-btn{color:#ffa200;font-size:0.14rem;}
	.weui-search-bar__input{color:#ffa200;}
	.weui-search-back{margin-left: 15px;margin-right: 10px;background:url(../../assets/imgs/back.png) center no-repeat; background-size:100%;padding:0 0.05rem;}
</style>
